package com.example.demosale;

import com.example.demoapi.product.Product;
import com.example.demoapi.product.ProductService;
import com.example.registerstarter.anno.RemoteReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author：kangxuan
 * @date：2024/9/30 2:10 PM
 * @desc:
 */
@RestController
public class SaleController {
    @RemoteReference
    private ProductService productService;

    @GetMapping("/sale")
    public Object sale(String name)
    {
        List<Product> list = productService.getList();
        return list;
    }

    @GetMapping("/sale2")
    public Object saleParam(String name,Product product)
    {
        List<Product> list = productService.getList(name,product);
        return list;
    }
}
